cc_opt = [
    '-I6.824/yfs-class/',
    '-I6.824/yfs-class/rpc/',
    '-Wno-error=vla',
    '-Wno-error=return-type',
    '-Wno-error=unused-variable'
]
cc_library(
    name = 'rpc',
    srcs = [
      'rpc/rpc.cc',
      'rpc/connection.cc',
      'rpc/pollmgr.cc',
      'rpc/thr_pool.cc',
      'rpc/jsl_log.cc',
      'gettime.cc'
    ],
    deps = [
        '#pthread',
        '#rt',
        '#dl'
    ],
    extra_cppflags = cc_opt
)
cc_binary(
    name = 'rpctest',
    srcs = [
        'rpc/rpctest.cc'
    ],
    deps = [
        ':rpc',
    ],
    extra_cppflags = cc_opt
)
cc_binary(
    name = 'lock_server',
    srcs = [
        'lock_server.cc',
        'lock_smain.cc',
    ],
    deps = [
        ':rpc',
    ],
    extra_cppflags = cc_opt
)

cc_library(
    name = 'lock_client',
    srcs = 'lock_client.cc',
    deps = [
        ':rpc'
    ],
    extra_cppflags = cc_opt
)
cc_binary(
    name = 'lock_tester',
    srcs = [
        'lock_tester.cc',
    ],
    deps = [
        ':rpc',
        ':lock_client'
    ],
    extra_cppflags = cc_opt,
    extra_linkflags = cc_opt,
)

cc_binary(
    name = 'lock_demo',
    srcs = [
        'lock_demo.cc'
    ],
    deps = [
        ':rpc',
        ':lock_client'
    ],
    extra_cppflags = cc_opt
)
